// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	2/21/2015 7:40:03 PM				
// -----------------------------

#ifndef _CThread_h
#define _CThread_h

#include "IThread.h"

namespace Flow
{

	class CThread : public IThread
	{
	public:
		CThread();
		virtual ~CThread();

		virtual void	Release();

		virtual void	Start(ThreadProc fn, void* lpArgs);
		virtual void	Stop();

		virtual void	WaitForExit();

		virtual Bool	IsRunning() const;

	private:

		static DWORD WINAPI ThreadProcWrapper(void* lpArgs);

		HANDLE			m_hThread;

		ThreadProc		m_Function;
		void*			m_lpArgs;

		CThread(const CThread& refCThread);
		CThread& operator=(const CThread& refCThread);
	};

}

#include "ExportMacro.h"
EXPORT_IMPLEMENTATION(Thread);

#endif